---
apiVersion: v1
kind: ConfigMap
metadata:
  name: node-local-dns
  namespace: kube-system
  {{- include "helm_lib_module_labels" (list .) | nindent 2 }}
data:
  Corefile: |
    .:53 {
      errors {
        consolidate 10s ".* i/o timeout$"
        consolidate 10s ".* write: operation not permitted$"
      }
      cache {
        success 39936
        denial 9984
        prefetch 10 1m 25%
        serve_stale 1h verify
      }
      reload 2s
      loop
      forward . {{ .Values.nodeLocalDns.internal.clusterDNSRedirectAddress }} {
        max_fails 0
      }
{{- if not (.Values.global.enabledModules | has "cni-cilium") }}
      bind {{ .Values.global.discovery.clusterDNSAddress }} 169.254.20.10
      prometheus 127.0.0.1:9254
      health 127.0.0.1:9225
{{- else }}
      prometheus 127.0.0.1:9254
      health 0.0.0.0:9225
{{- end }}
    }
